#include<stdio.h>
#include<stdlib.h>

int main()
{
	
	int ca[4],sum=0;
	printf("Put the values\nUse Space between values.\n");
	char card[4][4];
	int symbol=0;
	while(scanf("%2s %2s %2s",card[1],card[2],card[3])!=EOF)
	{
		sum=0;
		symbol=0;
		for(int i=1;i<=3;i++){
			switch(card[i][0])
			{
				case'j':
				case'q':
				case'k':
				  ca[i]=10;
				  break;
				case'a':
				  ca[i]=1;
				  break; 
				default:
				  ca[i]=atoi(card[i]);
			}
		if(ca[i]==1)
		  symbol=1;
		}
	
		
	sum=ca[1]+ca[2]+ca[3];
	
	if(sum+10<=21 && symbol==1)
	  sum+=10;
	  
	  
	  
	if(sum>21)
	{
	
	  printf("You lose.\n%d",sum);
	    }
	
	
	else{
	
	printf("You win!\n%d",sum);
        }
        
  }      
 return 0;
 } 
 

 
